<!DOCTYPE html>

<html lang='en'>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/react.development16.4.0.js"></script>
    <script src="./lib/react-dom.development16.4.0.js"></script>
    <script src="./lib/babel.min.js"></script>
</head>

<body>
    <div id="app">
    </div>
    <script type="text/babel">

         //e 是什么？ event 事件对象
         class MyCom extends React.Component {
             render() {
                 return (
                     <div>
                         <a href="http://www.baidu.com" onClick={(e)=>{console.log(e);e.preventDefault();}}>跳转</a>
                     </div>
                 )
             }
         }
         
         class MyCom01 extends React.Component {
             render() {
                 return (
                     <div>
                         <form action="http://www.baidu.com" method="get">
                         <input type="text" name="uname"/>
                         <input type="submit" value="提交" onClick={(e)=>{e.preventDefault()}}/>
                         </form>
                     </div>
                 )
             }
         }

        const el = <div><MyCom /><MyCom01 /></div>
        ReactDOM.render(
            el,document.getElementById('app')
        );
    </script>
</body>

</html>